package logic

import (
	"context"
	"jd-mall/jd/cache"

	"jd-mall/jd/internal/svc"
	"jd-mall/jd/jd"

	"github.com/zeromicro/go-zero/core/logx"
)

type CarDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCarDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CarDelLogic {
	return &CarDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CarDelLogic) CarDel(in *jd.CarDelRequest) (*jd.CarDelRequest, error) {
	// todo: add your logic here and delete this line
	cache.DelCar(int(in.UserId), int(in.GoodsId))
	return &jd.CarDelRequest{}, nil
}
